x,y,n,total=0,1,0,0
while n<=4000000:
	n=x+y
	x=y
	y=n
	if n%2==0:
		total+=n
print total